fn main() {
    let _t1: PhantomTuple<char, f32> = PhantomTuple('Q', PhantomData);
    let _t2: PhantomTuple<char, f64> = PhantomTuple('X', PhantomData);

    let _s1: PhantomStruct<char, i32> = PhantomStruct {
        first: 'q',
        phantom: PhantomData,
    };

    let _s2: PhantomStruct<char, f32> = PhantomStruct {
        first: 'x',
        phantom: PhantomData,
    };

    // println!("{}", _t1 == _t2); 不能比较
    // println!("{}", _s1 == _s2);
}
use std::marker::PhantomData;

#[derive(PartialEq)]
struct PhantomTuple<A, B>(A, PhantomData<B>);

#[derive(PartialEq)]
struct PhantomStruct<A, B> {
    first: A,
    phantom: PhantomData<B>,
}
